package com.jason.session;

import java.sql.SQLException;
import java.util.List;

public interface SqlSession {

    <E> List<E> selectList(String statementId, Object...params) throws Exception;

    <T> T selectOne(String statementId, Object...params) throws Exception;

    int insert(String statementId, Object...params) throws Exception;

    int update(String statementId, Object...params) throws Exception;

    int delete(String statementId, Object...params) throws Exception;

    <T> T getMapper(Class<T> classType);

    void close() throws SQLException;

    void setAutoCommit(boolean autoCommit);

    void commit() throws SQLException;

    void rollBack() throws SQLException;
}
